<?php 
require_once("model/loginBD.php");
function select_rightsBD() {
	$query = "SELECT id_right, name_right FROM rights"; 
								 
	logIn();
	$result = mysql_query($query) or die('Erreur SQL !'.$query.'<br>'.mysql_error());	
	logOut();
	$total = mysql_num_rows($result);
	if($total) {
		$i = 0;
		while($row = mysql_fetch_array($result)) {
			$tab['id_right'][$i] = $row['id_right'];
			$tab['name_right'][$i] = $row['name_right'];
			++$i;
		}
	}
	if( mysql_num_rows($result) > 0) return $tab;	else return 0;
}

?>